package list;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * Created by Zhou_Bing on 2018/12/7.
 */
public class SimilarList {

    public static void main(String[] args){

        List<String> first = new ArrayList<>();
        first.add("code1");
        first.add("code2");
        first.add("code3");

        List<String> second = new ArrayList<>();
        second.add("code2");
        second.add("code3");
        second.add("code4");


        List<String> noExists = new ArrayList<>(second);
        List<String> exists = new ArrayList<>(second);

        noExists.removeAll(first);
        exists.removeAll(noExists);
        System.out.println(noExists);
        System.out.println(exists);


    }

}
